package com.hzyc.internetshop.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hzyc.internetshop.bean.Article;
import com.hzyc.internetshop.bean.Goods;
import com.hzyc.internetshop.bean.Imgs;
import com.hzyc.internetshop.bean.Orders;
import com.hzyc.internetshop.bean.Page;
import com.hzyc.internetshop.bean.User;
import com.hzyc.internetshop.mapper.Houtaimapper;
import com.hzyc.internetshop.service.HoutaiService;

@Service
public class HoutaiServiceImp implements HoutaiService{
	
	@Autowired
	private Houtaimapper hm;
	
	@Override
	public List<Goods> sousuo_goodname(String name) {
		return hm.sousuo_goodname(name) ;
	}
	@Override
	public boolean add_ad(Imgs imgs) {
		boolean bol =false;
		try {
			hm.add_ad(imgs);
			bol=true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bol;
	}
	@Override
	public List<User> showuser() {
		
		List<User> list = null;
		try {
			
			list=hm.showuser();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return list;
		
	}
	@Override
	public String getPassword(String username) {
		String password = null ;
		try {
			password = hm.getPassword(username);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return password;
	}
	@Override
	public boolean addUser(User u) {
		boolean bol=false;
		try {
			
			hm.addUser(u);
			bol=true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bol;
	}
	@Override
	public List<Imgs> show_ads() {
		// TODO Auto-generated method stub
		return hm.show_ads();
	}
	@Override
	public boolean delete_ad(String id) {
		boolean bol=false;
		try {
			
			hm.delete_ad(id);
			bol=true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bol;
	}
	@Override
	public Imgs look_ad(String id) {
		// TODO Auto-generated method stub
		return hm.look_ad(id);
	}
	@Override
	public boolean remove_ad() {
		boolean bol=false;
		try {
			
			hm.remove_ad();
			bol=true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bol;
	}
	@Override
	public boolean use_ad(String id) {
		boolean bol=false;
		try {
			
			hm.use_ad(id);
			bol=true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return bol;
	}
	@Override
	public List<Orders> select_orders(Page page) {
		// TODO Auto-generated method stub
		return hm.select_orders(page);
	}
	@Override
	public int getordernum() {
		// TODO Auto-generated method stub
		return hm.getordernum();
	}
	@Override
	public List<String> tongji_allprice(String value) {
		System.out.println(value+"****************************************888");
		// TODO Auto-generated method stub
		return hm.tongji_allprice(value);
	}
	@Override
	public void addArticle(Article article) {
		hm.addArticle(article);
		
	}
	@Override
	public List<String> loadSecond() {
		
		return hm.loadSecond();
	}
	@Override
	public List<String> loadFirst() {
		// TODO Auto-generated method stub
		return hm.loadFirst();
	}
	@Override
	public void updateArticle(Article article) {
		hm.updateArticle(article);
		
	}
	
}
